package com.jrx.anytxn.param.dto.partner;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.jrx.anytxn.common.constant.RegexConstant;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 合作方额度调整请求参数
 */
public class PartnerLimitAdjustmentReq implements Serializable {

    /**
     * 交易流水号
     **/
    @ApiModelProperty(value = "流水号",required = true)
    @Size(max=32, message = "交易流水号必须小于32位")
    @Pattern(regexp = RegexConstant.ALL_CHARSET_AND_NUMBER, message = "流水号只能是英文字母和数字组成且不可为空")
    private String seqNo;

    /**
     * 租户ID
     **/
    @ApiModelProperty(value = "租戶id",required = true)
    @Size(max=4, message = "租戶id不能超过4位")
    @NotEmpty(message = "租戶id不可空")
    private String tenantId;

    /**
     * 合作方ID
     **/
    @ApiModelProperty(value = "合作方ID",required = true)
    @Size(max=32, message = "合作方ID不能超过32位")
    @NotEmpty(message = "合作方ID不能为空")
    private String partnerId;

    /**
     * 调整类型 0 扣减 1 恢复
     **/
    @ApiModelProperty(value = "调整类型",required = true)
    @Size(max=1, message = "调整类型不能超过1位")
    @NotEmpty(message = "调整类型不能为空")
    private String adjustmentType;

    /**
     * 调整金额
     **/
    @ApiModelProperty(value = "调整金额",required = true)
    @NotNull
    @Digits(integer=18, fraction=2,message="贷款金额最多俩位小数且长度不得大于18")
    @DecimalMin(value="0",message="贷款金额必需大于0")
    @JsonSerialize
    private BigDecimal amout;

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getPartnerId() {
        return partnerId;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getAdjustmentType() {
        return adjustmentType;
    }

    public void setAdjustmentType(String adjustmentType) {
        this.adjustmentType = adjustmentType;
    }

    public BigDecimal getAmout() {
        return amout;
    }

    public void setAmout(BigDecimal amout) {
        this.amout = amout;
    }
}
